#include "../include/head.h"
#include "../lib/error.h"
#include "menu.h"

int main(void)
{
	char strCmd[80];

    printf("Please enter the command!\n");
    printf("use \"exit\" to exit the system!\n:)");
    while(1)
    {
        char * s = fgets(strCmd, sizeof(strCmd), stdin); 
        if (s == NULL){
            perror("gets error");
            return -1;
        }
        printf(":)");
        if (strlen(strCmd) == 1) {
            continue;
        }
        strCmd[strlen(strCmd) - 1] = '\0';
            
        if (is_exit_cmd(strCmd) == 0){
            printf("exit the system!\n:)");
            break;
        }
        
        ExcuteCommand(strCmd);
     
    }
	return 0;
}
